const doctor = { template: '<router-view class="view"></router-view>' };
const login = (r) =>
  require.ensure([], () => r(require("../page/doctor/login")), "zw");
const loginPhone = (r) =>
  require.ensure([], () => r(require("../page/doctor/loginPhone")), "zp");
const register = (r) =>
  require.ensure([], () => r(require("../page/doctor/register")), "zw");
const doctorInfo = (r) =>
  require.ensure([], () => r(require("../page/doctor/doctorInfo")), "zw");
const regSucc = (r) =>
  require.ensure([], () => r(require("../page/doctor/regSucc")), "zw");
const portalQr = (r) =>
  require.ensure([], () => r(require("../page/doctor/portalQr")), "zp");
const rlink = (r) =>
  require.ensure([], () => r(require("../page/doctor/rlink")), "zw");
const memberList = (r) =>
  require.ensure([], () => r(require("../page/doctor/memberList")), "zp");
const lowerChannel = (r) =>
  require.ensure([], () => r(require("../page/doctor/lowerChannel")), "zw");
const list = (r) =>
  require.ensure([], () => r(require("../page/doctor/list")), "zp");

const resetPassword = (r) =>
  require.ensure([], () => r(require("../page/doctor/resetPassword")), "zw");
const editBank = (r) =>
  require.ensure([], () => r(require("../page/doctor/editBank")), "zw");
const home = (r) =>
  require.ensure([], () => r(require("../page/doctor/home")), "zp");

const NewMemberList = (r) =>
  require.ensure([], () => r(require("../page/doctor/newMemberList")), "zp");

export default {
  path: "/doctor",
  component: doctor,
  children: [
    {
      path: "/doctor/login",
      component: login,
      meta: { title: "登录", isChannel: false },
    },
    {
      path: "/doctor/loginPhone",
      component: loginPhone,
      meta: { title: "登录", isChannel: false },
    },
    {
      path: "/doctor/register",
      component: register,
      meta: { title: "注册", isChannel: false },
    },
    {
      path: "/doctor/home",
      component: home,
      meta: { title: "医生首页", isChannel: true },
    },
    {
      path: "/doctor/member/list",
      component: NewMemberList,
      meta: { title: "受试者列表", isChannel: true },
    },
    {
      path: "/doctor/rlink",
      component: rlink,
      meta: { title: "医生专用链接", isChannel: false },
    },
    {
      path: "/doctor/portalQr",
      component: portalQr,
      meta: { title: "专属二维码", isChannel: true },
    },
    {
      path: "/doctor/regSucc",
      component: regSucc,
      meta: { title: "恭喜你，注册成功", isChannel: true },
    },
    {
      path: "/doctor/doctorInfo",
      // component: doctorInfo,
      redirect: "/channel/home",
      meta: { title: "个人中心", isChannel: true },
    },
    {
      path: "/doctor/memberList",
      component: memberList,
      meta: { title: "会员列表", isChannel: true },
    },
    {
      path: "/doctor/lowerChannel",
      component: lowerChannel,
      meta: {
        title(to) {
          return "我的一级渠道";
        },
        isChannel: true,
      },
    },
    {
      path: "/doctor/list",
      component: list,
      meta: { title: "我的销售订单", isChannel: true },
    },
    {
      path: "/doctor/resetPassword",
      component: resetPassword,
      meta: { title: "修改密码", isChannel: true },
    },
    {
      path: "/doctor/editBank",
      component: editBank,
      meta: { title: "编辑银行信息", isChannel: true },
    },
  ],
};
